import http from '@/http/request';
import { LoginData, LoginResult, RefreshData,UserRoleReq } from '@/types/user';

export function loginApi(login: LoginData): Promise<Result<LoginResult>> {
  return http.post<LoginResult>('/api/sso/login', login);
}
export function refreshApi(refresh: RefreshData): Promise<Result<LoginResult>> {
  return http.postForm<LoginResult>('/api/sso/refresh', refresh,{__isRefresh:true});
}
export function demo(data: UserRoleReq): Promise<Result<void>> {
  return http.get<void>('/api/demo/get', data);
}